package cqwu.testSSH.Manager.Action;

import java.util.Date;

import org.hibernate.Session;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

import cqwu.testSSH.Manager.Util.HibernateSessionFactory;
import cqwu.testSSH.Manager.domain.Person;

public class Test {
	
	private static ApplicationContext ctx = null;
	private static JdbcTemplate jdbcTemplate;
	
	static{
		ctx = new ClassPathXmlApplicationContext("ApplicationContext.xml");
		jdbcTemplate = (JdbcTemplate) ctx.getBean("jdbcTemplate");
	}
	
	@org.junit.Test
	public void testSave(){
		Person person = new Person();
		person.setUsername("WW");
		String sql = "insert into Person values(?,?,?,?,?,?)";
		
		jdbcTemplate.update(sql,null,"ww",new Date(),"Ů",22,"123");
	}
	
}
